clear all
cap log close
set more off

// Define subdirectory locations ----------
global code = "${proj}/code"
global raw  = "${proj}/data/raw"
global out  = "${proj}/data/out"
global temp = "${proj}/_temp"
global log  = "${proj}/logs"
// ---------------------------------------

* initialize log file --------------------
log using "${log}/01-data_construct.log", text replace 

* run subprograms: build data -------------
do "${code}/data_construct/01-process_citation.do"
do "${code}/data_construct/02-process_court.do"
do "${code}/data_construct/03-process_crash.do"
do "${code}/data_construct/04-process_officer.do"
do "${code}/data_construct/05-process_driver.do"
do "${code}/data_construct/06-process_vehicle.do"
do "${code}/data_construct/07-process_gps.do" 
do "${code}/data_construct/08-process_violation.do" 
do "${code}/data_construct/09-build_offending.do" 
do "${code}/data_construct/10-build_stopsfhp.do"
do "${code}/data_construct/11-build_officer.do"
do "${code}/data_construct/12-build_main.do" 
* ----------------------------------------

* delete intermediate files --------------
rm "${temp}/process-citation.dta"
rm "${temp}/process-court.dta"
rm "${temp}/process-crash.dta"
rm "${temp}/step-1-officer.dta"
rm "${temp}/step-2-driver.dta"
rm "${temp}/step-3-vehicle.dta"
rm "${temp}/step-4-gps.dta"
rm "${temp}/violation.dta"
* ----------------------------------------

* end log file ---------------------------------------
log close


